-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(machines): Add 'Power cycle' as a feature-flagged action MAASENG-3945 #5566
feat(machines): Add 'Power cycle' as a feature-flagged action MAASENG-3945 #5566
Conversation
- Added empty reducer for powerCycle action to machine state slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA: singular, plural form and design 👍
Code: 👍
return formComponents[action](); | ||
}; | ||
|
||
const formComponents = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just translated the zen of python to JS. Explicit is better than implicit. Looks cleaner albeit being a little more code.
return formComponents[action](); | ||
}; | ||
|
||
const formComponents = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just translated the zen of python to JS. Explicit is better than implicit. Looks cleaner albeit being a little more code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had some network glitches, sorry for the duplicates
@@ -1,9 +1,13 @@ | |||
import { isValidPortNumber } from "."; | |||
|
|||
it("returns true for any number between 0 and 65535", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though shall not smuggle in unrelated changes in a PR.
(It's a good change and I can see it won't break things so let's merge it with this one)
return formComponents[action](); | ||
}; | ||
|
||
const formComponents = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just translated the zen of python to JS. Explicit is better than implicit. Looks cleaner albeit being a little more code.
Done
VITE_APP_DPU_PROVISIONING
feature flag to env (default:false
)getFormComponent
inMachineActionFormWrapper
to an object of key-value pairs to reduce complexity*for
loop test for valid ports with a handful of explicit test cases insrc/app/utils/isValidPortNumber.test.ts
**QA steps
VITE_APP_DPU_PROVISIONING = true
to your.env.local
Fixes
Resolves MAASENG-3945
Screenshots
Notes
*Adding another
case
to the existing switch pushes the function over the complexity limit of 25.**I decided that this was probably a bit silly, even if it didn't take that long to run.